﻿@model GameViewModel.TheGame

@{
    ViewBag.Title = "Игра";
}

@Html.ValidationSummary()
@{
    if (@Model.IsStarted)
    {
    <h1 id="bonusScore">Бонус: @Model.BonusScore</h1>
    <div>
        @{foreach (var person in @Model.Players.OrderBy(p => p.Order))
          {
            <fieldset data-role="controlgroup" data-type="horizontal" class="ui-widget">
                <legend>
                    <label>@person.Order. @person.Name: </label><label id="@person.Id">@person.PlayerScore</label>
                </legend>
                <input type="submit" data-icon="plus"  data-url="@Url.Action("PersonPlus", "Game")" personId="@person.Id" data-rel="plus" data-iconpos="notext" />
                <input type="submit" data-icon="minus" data-url="@Url.Action("PersonMinus", "Game")" personId="@person.Id" data-rel="minus" data-iconpos="notext" />
                <input type="submit" data-icon="alert" value="Штраф" data-url="@Url.Action("PersonPenalty", "Game")" personId="@person.Id" data-rel="penalty" data-iconpos="left" />
            </fieldset>
          }
        }
    </div>
    }
}

@if (@Model.IsStarted)
{
    <ul data-role="listview" data-inset="true">
        <li>@Html.ActionLink("Завершить", "Results", "Game")</li>
        <li>@Html.ActionLink("Сбросить", "Reset", "Game")</li>
    </ul>
}
else
{
    <ul data-role="listview" data-inset="true">
        <li data-role="list-divider">Меню</li>
        <li>@Html.ActionLink("Главная", "Index", "Home")</li>
        <li>@Html.ActionLink("Настройки", "Setup", "Home")</li>
        <li>@Html.ActionLink("О демиурге", "Contact", "Home")</li>
    </ul>
}

@section footer_scripts
{
    <script type="text/javascript" src="@Url.Content("/Scripts/game.js")"></script>
}
